Assignment:
For this week assignment I decided to use a sonar and program its interface in MATLAB.
I would like to say thanks to Ivan, who tried very hard to make me understand how to program an interface in MATLAB. It was difficult to me because I have no experience programming and my C++ language knowledge is very little, but with his assistance I could finish this assignment.
For this week assignment I use the sonar board I did on week 13.
The first step was design how the interface will look like. As I’ll design the interface for my sonar board, I decided to use buttons to change measurement units, the sonar C program makes the measurement in centimetres, so I’d like to change to millimetres or inches. I use a scroll bar to be able to visualise the sonars movements and a static text box where shows the distance measured depending on the units I selected to use. And finally a button to start and stop.
For each element I use in the interface design, I define a string name to identify the easier in when programming. I define the variables and formulas to change from one units measurement to another. Other important step was open the serial communication with the board and defining the port where the FTDI cable is connected, in this case was COM5.
Trying to understand sonar’s information, we detect that it sends information in groups of 6 numbers, one is the HIGH, then LOW and the other are numbers from 1 to 4 in sequence, it means that we had to define the position of the number which sonar makes the measurement.
Finally this is a short video of how the interface works.
SONAR INTERFACE from Damaris Cotto on Vimeo.